package com.leyou.common.threadlocals;

/**
 * 用户信息的ThreadLocal容器
 */
public class UserHolder {

    private static ThreadLocal<Long> tl = new ThreadLocal();


    public static void setUserId(Long userId){
        tl.set(userId);
    }

    public static Long getUserId(){
        return tl.get();
    }

    public static void removeUserId(){
        tl.remove();
    }
}
